<template>
  <div class="job-push">
    <div class="title">公司信息</div>
    <div class="push-content">
      <div class="push-item">
        <BInput label="公司名称" v-model="company.company_name"></BInput>
      </div>
      <div class="push-item">
        <BInput label="公司法人" v-model="company.boss_name"></BInput>
      </div>
      <div class="push-item">
        <BInput label="公司信用代码" v-model="company.code"></BInput>
      </div>
      <div class="push-item">
        <BText label="公司介绍" v-model="company.desc"></BText>
      </div>
      <div class="push-item">
        <BTags label="公司规模" v-model="company.people" :tags="peopleList"></BTags>
      </div>
      <div class="push-item">
        <BTags label="公司融资" v-model="company.scale" :tags="scaleList"></BTags>
      </div>
      <div class="push-item">
        <BInput label="企业地址" v-model="company.city"></BInput>
      </div>
      <div class="push-item">
        <BInput label="联系方式" v-model="company.tel">
          <template v-slot:next>
            <image class="ipt-icon" src=""></image>
          </template>
        </BInput>
      </div>
    </div>

    <div class="flex align-center justify-center btns">
      <div class="btn">取消</div>
      <div class="btn push"  @click="bindSubmit">发布</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import {ref, shallowRef} from "vue";
import BInput from "../../components/from/BInput.vue";
import BTags from "../../components/from/BTags.vue";
import BText from "../../components/from/BText.vue";
import {createCompany_data, jobCreate_data} from "../../api/Job";
import {goUrl, toastTxt} from "../../utils/UniUtil";
const tabIndex = ref(1);
const scaleList = shallowRef([
  {name: '未融资', id: '未融资'},
  {name: '天使轮', id: '天使轮'},
  {name: 'A轮', id: 'A轮'},
  {name: 'B轮', id: 'B轮'},
  {name: 'C轮', id: 'C轮'},
  {name: 'D轮及以上', id: 'D轮及以上'},
  {name: '已上市', id: '已上市'},
])
const peopleList = shallowRef([
  {name: '0-20人', id: '0-20人'},
  {name: '20-99人', id: '20-99人'},
  {name: '100-499人', id: '100-499人'},
  {name: '500-999人', id: '500-999人'},
  {name: '1000-9999人', id: '1000-9999人'},
  {name: '10000人以上', id: '10000人以上'},
])

const company = ref({
  company_name: '',
  code: '',
  tel: '',
  boss_name: '',
  scale: '已上市',
  city: '',
  people: '500-999人',
  desc: ''
})

const bindSubmit = () => {
  createCompany_data(company.value).then(() => {
    uni.navigateBack()
    toastTxt('创建成功')
  })
}
</script>

<style lang="scss" scoped>
.title {
  height: 42rpx;
  font-size: 30rpx;
  font-weight: 500;
  color: #0D3333;
  line-height: 42rpx;
  text-align: center;
}

.push-content {
  padding: 0 32rpx 32rpx;
  .push-item {
    padding: 32rpx 0 0;
    .ipt-icon {
      width: 44rpx;
      height: 44rpx;
      background: #24FAF6;
    }
  }
}

.btns {
  gap: 60rpx;
  padding: 32rpx 0 ;
  .btn {
    width: 192rpx;
    height: 64rpx;
    background: rgba(13, 51, 51, 0.08);
    border-radius: 20rpx;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 64rpx;
    text-align: center;
    color: #0D3333;;
    &.push {
      color: #000000;
      background: var(--main)
    }
  }
}
</style>
